#include "GlMatrix4x4.h"

#include "GlVector4.h"

namespace GraphicLibrary
{
	inline Vector4 operator * (const Vector4 &v, const Matrix4x4 &m)
	{
#		define _Mul(x, y)	(m(x, y) * v(x))
#		define _MulRow(y)	(_Mul(0, y) + _Mul(1, y) + _Mul(2, y) + _Mul(3, y))
		
		Vector4 ret;

		ret(0) = _MulRow(0);
		ret(1) = _MulRow(1);
		ret(2) = _MulRow(2);
		ret(3) = _MulRow(3);

		return ret;

#		undef _MulRow
#		undef _Mul
	}
}
